home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 013a / envlpe.zip / ENVELOPE.DOC < prev   
Text File  |  1991-10-24  |  7KB  |  107 lines

  1. *****************************************************************************
  2. * PROGRAM - envelope.bas  AUTHOR - Anthony Badger   DATE - Sept. 27, 1991   *
  3. *****************************************************************************
  4.  
  5. This program prints out a 5 line address on a business envelope with the
  6. Hewlett Packard LaserJet Series II printer.  This program has not been tested
  7. on any other printer, but it is my understanding it should work on any laser
  8. printer compatable with HP LJII commands and has manual feed.  The program can
  9. be modified to work on any laser printer be changing one line of commands.
  10.  
  11. The program is free for all to use, copy, change, mangle, etc.  I only ask
  12. that my name remain in the program and documentation as the original author.
  13. A few dollars to further my programming efforts would be appreciated, but I do
  14. not expect any for this program.  However, if there is a program you need or
  15. would like to see, I'd be happy to try and write it for you as shareware.
  16. I am about to begin writing a bank account program that can be easily
  17. customized to suit your needs and your bank.  If anyone has suggestions, please
  18. feel free to contact me.
  19.  
  20. My home address and network addresses:
  21.  
  22. Anthony G. Badger                   CompuServe : 72437,3350
  23. 81 Belmont Avenue                   GEnie      : T.BADGER
  24. No. Plainfield, NJ  07060-4362      Delphi     : TONYBADGER
  25.  
  26.                              END-USER DOCUMENTATION
  27.                              ----------------------
  28. The contents of the LZH package should be ENVELOPE.BAS, ENVELOPE.DOC, and a
  29. batch file called ENVELOPE.BAT.  The batch file contains the command:
  30.    C:\DOS\BASICA C:\DOS\ENVELOPE.BAS
  31. If you have a different BASIC language, substitute its path for \DOS\BASICA.
  32. This language should be Microsoft compatable. Also please add the full path
  33. name to ENVELOPE.BAS.  If you have it in a directory called \APPS, and you
  34. have GWBASIC in \DOS, the file should read:
  35.    C:\DOS\GWBASIC C:\APPS\ENVELOPE.BAS
  36. To run the program, just CD to the directory with the ENVELOPE.BAT file and
  37. type:
  38.    ENVELOPE
  39. Or use your menu system to run the ENVELOPE.BAT file.
  40.  
  41. The screen will clear and some instructions and rows of dots will appear.  The
  42. cursor moves to the first row of dots and you enter the address.  The dots
  43. simply show the maximum length each line can be.  All characters past the last
  44. dot will be truncated.  If a line is truncated, a warning will appear to the
  45. right of the line.  For a blank line, just press ENTER with nothing typed on
  46. that line.  Any dots remaining on a line will be erased to avoid confusion, and
  47. any line that needed truncating will have the extra letters erased.
  48.  
  49. To correct mistakes on the line you are typing on, use the BACKSPACE key, NOT
  50. the arrow keys or DELETE!  If you notice an error on a line you have already
  51. finished, you will be able to correct it later.  It is IMPORTANT that you never
  52. press the arrow keys!  The program is set up for line input, not full screen
  53. editing.
  54.  
  55. After the address is entered, you are asked if it is correct.  Pressing 'n'
  56. will allow you to edit the lines.  To leave a line unchanged, just press ENTER.
  57. To correct a line, you must retype the ENTIRE line. Again, NO ARROW KEYS!  You
  58. also have the option of quitting the program at this point by pressing 'q'.
  59.  
  60. When the address is correct and you have pressed 'y', some printer instructions
  61. are given for the HP LaserJet II.  The back tray is opened to keep the envelope
  62. from curling up too much.  When the printer display reads "PE FEED COM-10", you
  63. insert the envelope.  The envelope is inserted into the manual feed guides with
  64. the left edge pointing out and the envelope face up. If you are using envelopes
  65. with return addresses pre-printed, you should be able to see it on the left.
  66.  
  67. The address is printed on the envelope and you are asked if you wish to print
  68. another.  'y' re-runs the program, 'n' exits with a little warning message.
  69. The FORM FEED light will be on the printer, but it will have no effect on
  70. future printouts.  A blank page might print the next time the printer is used,
  71. but no harm is done to your next printout.  If you print out a second address,
  72. a blank page will print out before you are asked to insert the envelope.  If
  73. you find this annoying, use the RESET function of the printer command panel
  74. to remove the FORM FEED light.
  75.  
  76.                    FOR THE CURIOUS PROGRAMMERS OUT THERE
  77.                    -------------------------------------
  78. For those of you who are curious about the program or just programming, here
  79. are a few tidbits.  This is a structured BASIC program, meaning it is divided
  80. into sub-routines and a main module, with variables declared before hand (using
  81. REM statements and definition of constants).  The program could just as easily
  82. have been written unstructured (in fact, the original version was), but a
  83. structured program is much easier to follow, with as few GOTOs as possible
  84. (the only GOTO in the program is line 820, which is unavoidable, 3 WHILE-WEND
  85. loops are used to avoid GOTOs and branching).
  86.  
  87. The code itself is, as I mentioned to a friend, quite short.  The rest is fluff
  88. used to make the program readable and the execution look more professional.
  89. This is the 3rd version of the program.  The first was a 6 line program that
  90. printed out a specific address and was used to find the proper codes and
  91. spacing.  The second was unstructured but essentially the same as this third
  92. version.  Personally, I do not like BASIC, but it was all that had available.
  93. After reading the second code, I just had to make it structured (PASCAL and
  94. COBOL are forever in my blood).
  95.  
  96. If you are embarking on a similar program (a short specific purpose program),
  97. I suggest you do much the same thing, leaving out an 'unstructured' phase.
  98. After experimenting with the 'meat' of the program, write a pseudocode for
  99. the entire program.  This is like a flowchart, but in English (any good COBOL
  100. or structured language book should have a section on flowhcarting and pseudo-
  101. code.  So the evolution of the program is EXPERIMENT -> PSEUDOCODE -> CODE.
  102. Then test it as thoroughly as possible, have others who know nothing about the
  103. program try and use it.  Put plenty of comments in your program.  Not very
  104. obvious comments, but explanatory comments that explain your thinking during
  105. the coding.  This simple method ensures reliable programming and very readable
  106. program code.
  107.